<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/3/18 0018
 * Time: 23:08
 */

namespace app\common\validate;

use think\Validate;

class Article extends Validate
{
    protected $rule = [
        'title|文章标题' => 'require|unique:article',
        'cateid|所属导航' => 'require',
        'content|文章内容' => 'require'
    ];

    public function sceneAdd()
    {
        return $this->only(['title', 'cateid', 'content']);
    }

    public function sceneEdit()
    {
        return $this->only(['title', 'cateid', 'content']);
    }
}